package com.aoasaa;

import com.aoasaa.CreatingTextNotes.MyAsyncTask123;
import com.sendingFBpost.FBAppActivity;
import com.userrequestdtos.FileInfoStoringDTO;
import com.userutils.WSConnectionStrings;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;


public class UploadingVoiceNotes extends Activity {
	
	public SharedPreferences sp_obj;
	public Editor editor_obj;
	//EditText contents;
	  @Override  
	  public void onCreate(Bundle savedInstanceState) {  
	    super.onCreate(savedInstanceState); 
	    setContentView(R.layout.uploadingaudioscreenfile);
	
	        // accessing shared preference        
	 		sp_obj=getSharedPreferences("ArchiveApp",MODE_WORLD_WRITEABLE);
	 		editor_obj=sp_obj.edit();
	 		 
	 		EditText category=(EditText)findViewById(R.id.editText_finalaudiocategory);
			category.setText(sp_obj.getString("selectedfilecategory", "").toString());
			
			EditText title=(EditText)findViewById(R.id.editText_finalaudiotag);
			title.setText(sp_obj.getString("selectedfiletitle", "").toString());
			
			EditText audioname=(EditText)findViewById(R.id.editText_audioname);
			audioname.setText(sp_obj.getString("SelectedFile", "").toString());
			  
			// creating reference for save button      

			Button save=(Button)findViewById(R.id.btn_saveaudio);
			save.setOnClickListener(new View.OnClickListener() {
	   
				@Override  
				public void onClick(View v) {   
					// creating reference for controls
					
				//	contents=(EditText)findViewById(R.id.edittext_imagenotes);
					
					//storing values in shared preference
					  
			//		editor_obj.putString("selectedfilenotes", contents.getEditableText().toString());
	             //   editor_obj.commit(); 
	             
					
					// adding preference variable for checking saving or sharing
					
					editor_obj.putString("checkingSAVEorFB", "SAVE");
					editor_obj.commit();
					// using intent to navigate to uploading activity
					
					Intent obj=new Intent(UploadingVoiceNotes.this,UploadingDocumentTOPHP.class);
					startActivity(obj);    
				}    
			});

			// SHARE Button reference i.e, sharing note on face book
   
			Button share=(Button)findViewById(R.id.btn_shareaudio);
			share.setOnClickListener(new View.OnClickListener() { 
    
				@Override
				public void onClick(View v) { 
					// creating reference for controls 
					//title=(EditText)findViewById(R.id.et_textag);
					//contents=(EditText)findViewById(R.id.et_textnote);
					// FB LOGIC
       
					// adding preference variable for checking saving or sharing
					 
					editor_obj.putString("checkingSAVEorFB", "FB");
					editor_obj.putString("check_FBnotestype", "voice");
					editor_obj.commit();
					 
	               // using intent to navigate to uploading activity
					
					Intent obj=new Intent(UploadingVoiceNotes.this,UploadingDocumentTOPHP.class);
					startActivity(obj); 
					
					
				}
			});
	  }
}

